﻿@{
    Layout = null;
}

@if (Model == null)
{                   
    <div class="non-product">
        Chưa có sản phẩm nào trong danh sách ưa thích của bạn!
    </div>
}
else
{             
    <div class="cartQty">
        Có <a href='javascript:;' onclick="javascript:loadAction('WishlistView','Account')">
            <span id="pInWish">@Enumerable.Count(Model)</span> sản phẩm</a> ưa thích. 
    </div>    
    <hr />
    
    foreach(var wish in Model)
    {
    <div class="product">
        <div class="product-image">
            <a href="javascript:;" onclick="javascript:viewProduct(@wish.Product.ID)">
                <img src="/Content/data/images/350.300/@wish.Product.image_link" alt="" height="50"></a>
        </div>
        <div class="product-detail">
            <a class="widget-btn" href="javascript:;" title="Xóa sản phẩm khỏi danh sách ưa thích" onclick="javascript:deleteWishlist(@wish.Product.ID)">
                <img src="/Content/data/icon/list_remove_btn.gif" alt=""></a>
            <div>
                 <a href="javascript:;" onclick="javascript:viewProduct(@wish.Product.ID)">@wish.Product.name</a>
            </div>
            <div>
                @{var price = wish.Product.price;}
                @if (wish.Product.promotion_ID > 0)
                {
                    price = wish.Product.price / 100 * (100 - wish.Product.Promotion.rate);
                }
                <span class="price">@price.ToString("0,0") VND</span>                
            </div>
        </div>
    </div>
    }
    <br />
    
    <div  class="action myBtn1">
        <a href='javascript:;' onclick="javascript:loadAction('WishlistView','Account')" style="color:#FFFFFF;">Danh sách yêu thích</a>
    </div>
}
